package handler

import (
	"github.com/gin-gonic/gin"
	"video-proj/internal/dto"
	"video-proj/internal/model"
	"video-proj/response"
)

func ShowVideo(c *gin.Context) {

	var video model.Video
	err := c.ShouldBind(&video)
	if err != nil {
		response.Error(c, "解析失败")
		return
	}
	err = dto.ShowVideo(&video, int(video.ID))
	if err != nil {
		response.Error(c, "查询失败")
		return
	} else {
		response.Success(c, "查询成功", video)
	}
}
